Skip to content

feat: select ring buffer topics by message type#3

Merged
marc-hanheide merged 2 commits into
mainfrom
copilot/add-topic-selection-by-type
Mar 12, 2026
Merged

feat: select ring buffer topics by message type#3
marc-hanheide merged 2 commits into
mainfrom
copilot/add-topic-selection-by-type

Conversation

Copilot AI commented Mar 12, 2026

Copy link
Copy Markdown

Topics could only be matched by name/glob pattern. This adds type-based selection so entries like type: "geometry_msgs/msg/Twist" record all topics of that type regardless of their name. The node's existing periodic discovery loop picks up newly published topics automatically.

Changes

  • topic_filter.pyfind_matching_config gains an optional type_name parameter. Config entries now support:
    • pattern – existing Zenoh glob on topic name
    • type – exact message type match
    • both keys present → AND logic (both must match)
    • neither key → entry skipped
  • ringbuffer_node.py – passes type_names[0] to find_matching_config during discovery
  • example_config.yaml – documents the new type key with a geometry_msgs/msg/Twist example
  • test_topic_filter.py – 11 new tests covering type-only, combined, and edge-case scenarios

Example config

topics:
  # Record all Twist messages, whatever topic they appear on
  - type: "geometry_msgs/msg/Twist"
    max_frequency: 10.0
    qos:
      reliability: best_effort
      durability: volatile
      depth: 10

  # Name-based selection unchanged
  - pattern: "/camera/**"
    max_frequency: 10.0

  # Both keys: topic name AND type must match
  - pattern: "/cmd_vel"
    type: "geometry_msgs/msg/Twist"

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

- topic_filter.py: extend find_matching_config with optional type_name
  parameter; entries with a 'type' key are matched by exact message type,
  entries with a 'pattern' key by name glob, both keys AND-ed together
- ringbuffer_node.py: pass type_names[0] to find_matching_config so
  type-based config entries are evaluated during topic discovery
- example_config.yaml: add geometry_msgs/msg/Twist type-selector example
- test_topic_filter.py: 11 new tests covering type-only, combined, and
  edge-case matching scenarios

Co-authored-by: marc-hanheide <1153084+marc-hanheide@users.noreply.github.com>
Copilot AI changed the title [WIP] Add functionality to select topics by type for recording feat: select ring buffer topics by message type Mar 12, 2026
@marc-hanheide
marc-hanheide marked this pull request as ready for review March 12, 2026 09:49
@marc-hanheide
marc-hanheide merged commit c4a981c into main Mar 12, 2026
3 checks passed
@marc-hanheide
marc-hanheide deleted the copilot/add-topic-selection-by-type branch March 12, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants